Skip to content

feat: add kernelgen backend#56

Open
ymwangg wants to merge 1 commit intomainfrom
feat/kernelgen
Open

feat: add kernelgen backend#56
ymwangg wants to merge 1 commit intomainfrom
feat/kernelgen

Conversation

@ymwangg
Copy link
Copy Markdown
Contributor

@ymwangg ymwangg commented Apr 27, 2026

Summary

  • Add a kernelgen backend that generates NKI kernels via MLIR as an alternative to the existing HLO backend, with MLIR encapsulated behind a builder API
  • Unify the IR interface across HLO and kernelgen backends with a common ComputationIR abstraction, including uniform input/output name resolution and compilation delegation
  • Add op implementations for the kernelgen backend (_kernelgen_impls.py, _register_kernelgen.py) with support for inplace updates (dynamic_update_slice) and custom ops via nki_op.nki_custom_op
  • Add comprehensive unit tests (test_kernelgen_backend.py), op tests (test_kernelgen_ops.py), and numerical tests (test_kernelgen_numerical.py)

Test plan

  • uv run pytest tests/unit/test_kernelgen_backend.py -v -n auto
  • uv run pytest tests/test_kernelgen_ops.py -v -n auto
  • uv run pytest tests/test_kernelgen_numerical.py -v -n auto
  • uv run pytest tests/ -n auto (full suite)

@ymwangg ymwangg requested a review from a team April 27, 2026 19:48
Add a complete kernelgen backend that generates NKI kernels via MLIR,
as an alternative to the existing HLO backend. This includes:

- Kernelgen backend with MLIR encapsulated behind a builder API
- Op implementations for kernelgen (_kernelgen_impls.py)
- Inplace update (dynamic_update_slice) support
- Unified IR interface for HLO and kernelgen backends
- Custom op interface via nki_op.nki_custom_op
- Compilation delegation to nkipy_kernelgen.compile
- Comprehensive unit and numerical tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants